package com.foruo.learn.designmode.flyweight;

/**
 * 测试
 * @author GaoYuan
 */
public class TestMe {

    public static void main(String[] args){
        String type = "dress";
        Goods goods = (Goods)GoodsFactory.getGoods(type);
        goods.setSize("10");
        goods.setPrice("100");
        goods.sell();

        goods = (Goods)GoodsFactory.getGoods(type);
        goods.setSize("11");
        goods.setPrice("110");
        goods.sell();

        type = "jeans";
        goods = (Goods)GoodsFactory.getGoods(type);
        goods.setSize("30");
        goods.setPrice("1200");
        goods.sell();

        goods = (Goods)GoodsFactory.getGoods(type);
        goods.setSize("31");
        goods.setPrice("1500");
        goods.sell();

    }
}
